#include "DnsServerConfiguration.h"
#include "threads.h"
#include "socketServerData.h"
#include "socketServerThread.h"
#include "resolverData.h"
#include "resolverThread.h"
#include "udpMessageQueue.h"
#include <vector>

int main( int argc, char *argv[])
{
	DnsServerConfiguration serverConf( argc, argv ); 
	UDPMessageQueue resolverQueue;

	Thread serverThread( socketServerThread );
	SocketServerData socketServerData( &serverConf, &resolverQueue );
	serverThread.start( &socketServerData );

	int numResolverThread = 1;
	std::vector< Thread* > resolverThreads;

	ResolverData resolverData( &serverConf, &resolverQueue );
	for( int i = 0; i < numResolverThread; ++i )
	{
		resolverThreads.push_back( new Thread( resolverThread ) );
		resolverThreads[i]->start( &resolverData );
	}
	

  //End
	serverThread.join();

}
